<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateMoneyboxTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('moneybox', function (Blueprint $table) {
            $table->id()->from(config('migration.from'));

            $table->uuid('uuid');
            $table->string('method');
            $table->enum('status', [0, 1, 2])->default(false);

            $table->jsonb('request')->default(json_encode([]));
            $table->timestamp('request_time')->nullable();

            $table->jsonb('response')->default(json_encode([]));
            $table->integer('response_code')->nullable();
            $table->timestamp('response_time')->nullable();


            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('moneybox');
    }
}
